package com.zhaojindong.ioc.component.register.scopeandlazy;

import lombok.extern.log4j.Log4j;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @description:
 * @author: zhaojindong
 * @create: 2018-08-13 20:52:47
 **/
@Log4j
public class MainTest {

    @Test
    public void testMethod() {
        ApplicationContext context = new AnnotationConfigApplicationContext(MainConfig.class);
        log.info("ioc container created");

        Person bean = context.getBean(Person.class);
        Person bean1 = context.getBean(Person.class);
        log.info(bean == bean1);
    }
}
